using UnityEngine;

[ExecuteInEditMode]
public class ControllerBallSpawnPoint : ControllerGeneric
{
	private void Update()
	{
		if (Application.isEditor && !Application.isPlaying)
		{
			SetupRemoteControl();
			if (IsRemoteControlActive())
			{
				base.transform.position = remoteControl.transform.position;
				base.transform.rotation = remoteControl.transform.rotation;
			}
			if (remoteControl != null)
			{
				remoteControl.transform.localScale = Vector3.one;
				remoteControl.scale = Vector3.one;
			}
			Setup();
		}
	}

	private void Setup()
	{
		AssureParenting();
	}

	public void SetupRemoteControl()
	{
		if (remoteControl == null)
		{
			InitRemoteControl();
			remoteControl.gameObject.name = remoteControl.gameObject.name + base.name;
			remoteControl.gameObject.transform.position = base.transform.position;
			remoteControl.gameObject.transform.rotation = base.transform.rotation;
			remoteControl.gameObject.transform.localScale = Vector3.one;
		}
	}
}
